﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOCSample
{
    public class NewRunner : RunnerBase, IRunner
    {
        NewRunner Runner { get; set; }

        protected override string Name
        {
            get { return "new"; }
        }

        public void Start(RunType runType)
        {
            if (runType == RunType.Singleton)
            {
                if (Runner == null)
                    Runner = new NewRunner();
                Time(() =>
                {
                    var runner = Runner;
                });
            }
            else
            {
                Time(() =>
                {
                    var runner = new NewRunner();
                });
            }
        }
    }
}
